home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 March / CHIP Mart 1997.iso / prg / CHKIO / CHKIO.DOC < prev    next >
Encoding:
Text File  |  1996-06-05  |  13.7 KB  |  307 lines

  1.  
  2.                         Q&D CheckIOPorts v1.32
  3.  
  4.  
  5.                        Copyright (c) 1996 by PhG
  6.                           All rights reserved
  7.  
  8.                      Last revision on June 6, 1996
  9.  
  10.  
  11. OVERVIEW
  12.  
  13.       CHKIO *tries* to locate I/O ports used by cards installed in a PC. 
  14.       It can use four different spying methods (of various usefulness)
  15.       to perform this search.  Even better: it can be run as a TSR, in
  16.       order to spy on those clever (i.e. here: well-designed) cards which
  17.       keep a low profile and do not reveal their presence in a system
  18.       unless their I/O ports are activated.
  19.  
  20.       This program was written for personal use and curiosity: as such,
  21.       it is not a masterpiece nor is it foolproof.  Yet, it may be of
  22.       some use to some people, for I cannot remember any utility
  23.       performing its humble task (which does *not* mean such an utility
  24.       does not *already* exists!).  Besides, it raises some interesting
  25.       problems about hardware (at least, from a software point of view).
  26.  
  27.       So...
  28.  
  29.  
  30. SYSTEM REQUIREMENTS
  31.  
  32.       CHKIO should run on any IBM PC or compatible with a 8086 processor
  33.       or better, and DOS 3.1 or higher.  Anyway, when run as a TSR, it
  34.       *requires* about 350 Kb of EMS memory (yes, EMS, not XMS).
  35.  
  36.       Warning!!!  In your own interest, please *read* the full
  37.       documentation file *before* running the program!
  38.  
  39.  
  40. CAVEATS
  41.  
  42.       If you do not feel comfortable with a program which _READS_ I/O
  43.       ports (nothing else!), then do *not* run CHKIO.  If you do not
  44.       realize *all* the implications of reading I/O ports without knowing
  45.       what you're doing, then do *not* run CHKIO.  Program should be run
  46.       from plain vanilla DOS only: it was *not* intended to be run in any
  47.       form of clever DOS emulation such as You-Know-Who's graphics
  48.       integrators and/or operating systems.
  49.  
  50.       CHKIO is intended as a (small) diagnostic utility: when running it,
  51.       especially as a TSR, do *not* expect normal behavior of you PC. 
  52.       For instance, reading hard disk and floppy controllers I/O ports
  53.       ($320..$32F and $3F0..$3F7) *may* damage your data (it has *not*
  54.       occurred during extensive tests, but it *may* happen: so, better
  55.       be safe than sorry!).  Use the "divide and conquer" approach and
  56.       do not try to test for too big a range of I/O ports!
  57.  
  58.       In other words, if you run CHKIO, run it to detect a card activity,
  59.       but don't expect the card to run normally.  Once you have located
  60.       probable I/O addresses used by a card, turn your PC off then on
  61.       again, in order to restart with a clean system.  CHKIO does nothing
  62.       but *read* I/O ports: it may prevent other programs (measure, for
  63.       instance) from getting data they expect.  When run as a TSR, CHKIO
  64.       forces a small penalty on your system, which may be an annoyance
  65.       for a realtime measurement board.
  66.  
  67.       So, do *not* forget CHKIO will help you to diagnostic and to
  68.       *diagnostic* ONLY!
  69.  
  70.  
  71. USAGE
  72.  
  73.       Just type CHKIO from DOS command prompt in order to get this help:
  74.  
  75. Q&D CheckIOPorts v1.32 (c) PhG 1996
  76.  
  77. Syntax: 'CHKIO <options> [>file]', where options (without / or -) are:
  78.  
  79. - <port> [count] checks 'count' I/O ports starting from 'port'
  80.   'port' belongs to the [$0000..$03FF] range, 'count' default value is 16
  81.   Values are given in decimal, unless they begin with a '$' for hexadecimal
  82. - FREE shows the most probably unused I/O ports in the [$0200..$03FF] range
  83. - USED shows the most probably used I/O ports in the [$0200..$03FF] range
  84. - SAMPLE <ticks> <port> [count] install program as a TSR
  85.   'ticks' is the sampling frequency (one tick is 1/18.2s)
  86. - RESET reinitializes results got from TSR
  87. - REPORT dumps current results to CHKIO.RPT file
  88.   Previous file of same name is kept as CHKIO.BAK
  89. - STATUS shows current TSR status
  90. - UNLOAD tries and unloads program from memory"
  91.  
  92. For SAFETY, FREE and USED commands do NOT test hard disk and floppy I/O ports.
  93. Program can *try* 4 methods to check whether I/O ports are used or not.
  94. To specify survey method, enter M0, M1, M2 or M3 as the *first* parameter.
  95. Default is M0. Beware: once program is TSR, you CANNOT change survey method!
  96.  
  97. Special thanks to Jean-Claude Gaertner and Rick Harris who kindly devoted
  98. some of their precious time in order to have a look at this small utility!
  99.  
  100.       Here are some examples of use from DOS command line:
  101.  
  102.       CHKIO $220
  103.       CHKIO $330 8
  104.       CHKIO FREE
  105.       CHKIO USED
  106.       CHKIO SAMPLE 18 $300 32
  107.       CHKIO REPORT
  108.       CHKIO RESET
  109.       CHKIO UNLOAD
  110.       CHKIO M1 $220
  111.       CHKIO M2 SAMPLE 32 $220
  112.  
  113.       Note you'll have to enter exactly "yES" ("y", "E", "S" without
  114.       quotes, of course!) in order to run the program after you've
  115.       specified a valid command: this is to protect you from yourself. 
  116.       Logically, you _should_ notice the following message:
  117.  
  118.       ****************************************************************
  119.       * Warning!!!  Think twice before you run this program!         *
  120.       * In your own interest, be sure you have fully read CHKIO's    *
  121.       * documentation *before* you proceed, for running this program *
  122.       * without knowing what it is about is definitely *not* wise!   *
  123.       * This warning is all the more important with TSR option!      *
  124.       ****************************************************************
  125.  
  126.       There's even a small beep for added safety. <g>  In the same way,
  127.       you'll have to enter exactly "yES" in order to go back to DOS when
  128.       the program ends, after the following message (again, with an added
  129.       small beep):
  130.  
  131.       ****************************************************************
  132.       * Warning!!!  Think twice before you exit this program!        *
  133.       * Whatever I/O ports have been tested, you definitely should   *
  134.       * turn you PC off then on again!  At any case, you'd better    *
  135.       * not exit to DOS now but reboot your system instead!          *
  136.       ****************************************************************
  137.  
  138.       Should you enter anything EXCEPT "yES" string, your PC will be
  139.       rebooted for safety (an even greater safety would be to turn it off
  140.       then on again... which unfortunately cannot be done by current
  141.       software! <g>).  You'll have to do something in order to remove the
  142.       boring message:
  143.  
  144.       ********************************************************
  145.       * System is now willingly lost in an infinite loop!    *
  146.       * Either reboot with Ctrl-Alt-Del or the Reset button! *
  147.       * Even better, turn your PC off then on again!         *
  148.       ********************************************************
  149.  
  150.       I first thought of a cryptic "Lost in the Twilight Zone", but,
  151.       well... this utility is supposed to be a little serious. ;-)
  152.  
  153.       Beginning with version 1.3, in order to protect the innocent, hard
  154.       disk and floppy controllers I/O ports ($320..$32F and $3F0..$3F7
  155.       if Thom Hogan's _Programmer's PC Sourcebook_ is right!) are *not*
  156.       tested.  If you want to test these ports, you'll have to specify
  157.       them individually at your own risk!  If this potentially dangerous
  158.       addresses are to be tested, you'll get the following message on
  159.       screen:
  160.  
  161.       Program output results can be redirected to a file in the usual DOS
  162.       way (for instance, CHKIO FREE > FOOBAR.TXT).
  163.  
  164. THEORY
  165.  
  166.       I wrote this utility a few days ago because I suddenly wondered
  167.       what I/O ports were used by my Panasonic CR-562B CD-ROM proprietary
  168.       card.  I tried to locate infos about software detection of hardware
  169.       ports without any real success.  With a few lines of code, I
  170.       thought I could assume that any port returning $FFFF word value
  171.       when read was to be considered as free.  A TSR version of CHKIO was
  172.       suggested by a friend, for these cards which use I/O ports only
  173.       when needed.
  174.  
  175.       I'm not a hardware specialist (and I'm no longer a software
  176.       writer).  So, I have implemented, just in case, and even if it may
  177.       look stupid, four "detection" methods in CHKIO.
  178.  
  179.       Method 0 reads a byte from port address then a byte from address+1,
  180.       and checks if the word value just read equals $FFFF.
  181.  
  182.       Method 1 reads a byte from port address then a byte from address+1,
  183.       and checks if the two bytes differ from one another.
  184.  
  185.       Method 2 reads two bytes in succession from port address and checks
  186.       if they are both equal to $FF.
  187.  
  188.       Method 3 reads two bytes in succession from port address and checks
  189.       if the two bytes differ from one another.
  190.  
  191.       My guess is that method 0 is to be used (most cards are supposed
  192.       to read words).  Yet, I decided to include "cookie beta parameter"
  193.       in order to let other people have fun (!) experimenting with these
  194.       four methods.  Hence the [ M0 | M1 | M2 | M3 ] parameter.  Method
  195.       3 seems uterless useless.
  196.  
  197.       Most cheap (or badly designed) cards seem to reveal their presence
  198.       on a PC by returning values different from $FFFF on some ports,
  199.       whether software drivers (if needed) are present or not.
  200.  
  201.       If you have any infos about that point, you're welcome to share
  202.       them!
  203.  
  204.  
  205. ERROR MESSAGES
  206.  
  207.       They are self-explanatory.
  208.  
  209.  
  210. REVISION HISTORY
  211.  
  212.       Version 1.32 completed on June 6, 1996.
  213.             Fixed a small discrepancy between this doc and help screen. 
  214.             Removed the possibility for the TSR to use a swapfile, for
  215.             safety.  Thanks again for pointing these ones, Rick! 
  216.             Included for inquisitive mindes are the original M2 code and
  217.             current Basic code.
  218.       Version 1.3 completed on May 26, 1996.
  219.             "No future", as they say... Well... Added an opening warning
  220.             screen and a closing warning screen at request of Rick
  221.             Harris, in order to protect the innocent and those people who
  222.             are proud to never read the documentation. <g>  For the same
  223.             reason, FREE and USED commands no longer check hard disk and
  224.             floppy controllers I/O ports ($320..$32F and $3F0..$3F7).
  225.       Version 1.2 completed on April 23, 1996.
  226.             Fixed a few typos, code frozen and no future!
  227.       Version 1.12 completed on April 19, 1996.
  228.             Fixed a few typos in documentations and in source code
  229.             (including one which prevented 1.11 from working as 1.1
  230.             did!). Program sent to Rick Harris, sysop of Benchmark &
  231.             Standards CIS Forum, for beta test.
  232.       Version 1.11 completed on April 17, 1996.
  233.             Default range for FREE and USED commands is now limited to
  234.             $0200..$03FF.
  235.       Version 1.1 completed on April 15, 1996.
  236.             Full rewrite in PowerBASIC v3.1, for TopSpeed Modula-2 TSR
  237.             would have required about 50 Kb of conventional memory.
  238.       Version 1.0 created on April 8, 1996.
  239.             Written the Quick & Dirty way in TopSpeed Modula-2 v3.1.
  240.  
  241.  
  242. SPECIAL THANKS
  243.  
  244.       Special thanks to Jean-Claude Gaertner and Rick Harris who kindly
  245.       devoted some of their precious time in order to have a look at this
  246.       small utility!  They suggested some great ideas, most of which I'm
  247.       unfortunately unable to implement in this Q&D utility.
  248.  
  249.  
  250. DISCLAIMER
  251.  
  252.       Legal mumbo-jumbo and the like.  I understand I'm supposed to
  253.       include it, just in case.  Sorry! ;-)
  254.  
  255.       The CHKIO package is provided *without* warranty of *any* kind,
  256.       except for this one: the executable CHKIO.EXE and its documentation
  257.       CHKIO.DOC will use some space on your hard disk (or on any other
  258.       storage device).  Moreover, CHKIO will keep your CPU busy when you
  259.       run it.  The author hereby disclaims all warranties relating to
  260.       this software, whether express or implied, including without
  261.       limitation any implied warranties of merchantability or fitness for
  262.       any particular purpose.  The author will not be liable for any
  263.       special, incidental, consequential, indirect or similar damages due
  264.       to loss of data or any other reason, even if the author has been
  265.       advised of the possibility of such damages.  In no event shall the
  266.       author's liability for any damages ever exceed the price paid for
  267.       the license to use software (i.e. nothing at all, for CHKIO is
  268.       freeware!), regardless of the form of the claim.  The person using
  269.       the software bears all risk as to the quality and performance of
  270.       the software.  Caveat utilisator, as they say in pseudolatin.
  271.  
  272.  
  273. LICENSE AND COPYING
  274.  
  275.       CHKIO is freeware, for I know shareware does not pay, and
  276.       postcardware does not even work better <g>.  Moreover, every
  277.       programmer always knows he can do better than any utility he looks
  278.       at, provided he has time enough! ;-).  And well... I found enough
  279.       interesting things in Benchmark & Standards forum to try and give
  280.       them back something.  Yet, I reserve all "rights", if any, to the
  281.       program and its source code.  If you were to create a derivative
  282.       work from my Q&D source code, please acknowledge the original work
  283.       (it's a matter of principle).  Please release only original
  284.       unmodified CHKIO.LZH archive with the following files kept
  285.       together : CHKIO.EXE, CHKIO.BAS, CHKPORTS.MOD, CHKPORTS.PR and
  286.       CHKIO.DOC.
  287.  
  288.       You may still let me know if this program was useful to you or not!
  289.  
  290.  
  291. BUGS
  292.  
  293.       None known to date.  Which does not mean there are none.  Please
  294.       read supra CAVEATS section.
  295.  
  296.  
  297. FUTURE -- IF ANY!
  298.  
  299.       No.
  300.  
  301.  
  302. IMPORTANT NOTE
  303.  
  304.       I apologize for the... well, quality of my writing in English.  To
  305.       me, this language is to be read, not written <cum grano salis>!
  306.  
  307.